import { PageReq, PageRes } from '@/api/types'
import request from '@/utils/request'
import { ReceiveModel } from '@/api/model/workflow/receive-model'

// 获取领用列表
export function receivePageApi(data: PageReq<Partial<any>>) {
  return request<PageRes<any>>({
    url: '/receive/page',
    method: 'post',
    data
  })
}

// 新增领用
export function addReceiveApi(data: Partial<ReceiveModel>) {
  return request({
    url: '/receive/add',
    method: 'post',
    data
  })
}

// 更新领用
export function editReceiveApi(data: Partial<ReceiveModel & { id: number }>) {
  return request({
    url: '/receive/edit',
    method: 'post',
    data
  })
}

// 删除领用
export function delReceiveApi(data: { id: number }) {
  return request({
    url: '/receive/del',
    method: 'post',
    data
  })
}
